<template>
  <div class="about">
    <h1>测试页</h1>
  </div>
</template>

<script lang="ts">
import { defineComponent, reactive, toRefs, onMounted } from 'vue'
import { getUserList } from '../api/user'

export default defineComponent({
  name:'Test',
  components:{},
  setup() {
    const state = reactive({
      currentPage : 1,
      limit: 10
    })
    const getDataList = async () => {
      try {
        let params = {
          page: state.currentPage,
          limit: state.limit
        };
        let res = await getUserList(params);
        console.log(res);
      } catch (error) {
        console.log(error);
      }
    };
    onMounted(() => {
      getDataList()
    });
    return {
      ...toRefs(state)
    }
  },
})
</script>

